let buf1 = Buffer.alloc(20);

buf1[1] = 'a';


console.log(buf1)

let buf2 = Buffer.from('你好');

// console.log(buf2)


buf1.write('世')

console.log(buf1)

let c = 'a'+'b'; //ab

let bufa = Buffer.from('a');

let bufb = Buffer.from('b');

let buf = Buffer.concat([bufa,bufb]);

console.log(buf.toString())

console.log(Buffer.byteLength(buf2))

console.log(Buffer.isBuffer(c) )

console.log(Buffer.isEncoding('utf8'))


const fs = require('fs');

// fs.readFile('./cli-2.wmv',(error,data) => {
//     if(error) throw error;
//     console.log(data);
//     fs.writeFileSync('./cli-copy.wmv',data)
// })

fs.readFile('./buffer.md',(error,data) => {
    console.log(data)
})
